package com.qj.yantaishan.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import com.qj.yantaishan.mapper.CommentAttachmentMapper;
import com.qj.yantaishan.domain.CommentAttachment;
import com.qj.yantaishan.service.ICommentAttachmentService;
import com.qj.yantaishan.common.core.text.Convert;

/**
 * 评论附件Service业务层处理
 * 
 * @author qihe
 * @date 2022-07-22
 */
@Service
@Primary
public class CommentAttachmentServiceImpl    extends ServiceImpl<CommentAttachmentMapper, CommentAttachment>  implements ICommentAttachmentService
{
    @Autowired
    private CommentAttachmentMapper commentAttachmentMapper;

    /**
     * 查询评论附件
     * 
     * @param id 评论附件主键
     * @return 评论附件
     */
    @Override
    public CommentAttachment selectCommentAttachmentById(Long id)
    {
        return commentAttachmentMapper.selectCommentAttachmentById(id);
    }

    /**
     * 查询评论附件列表
     * 
     * @param commentAttachment 评论附件
     * @return 评论附件
     */
    @Override
    public List<CommentAttachment> selectCommentAttachmentList(CommentAttachment commentAttachment)
    {
        return commentAttachmentMapper.selectCommentAttachmentList(commentAttachment);
    }

    /**
     * 新增评论附件
     * 
     * @param commentAttachment 评论附件
     * @return 结果
     */
    @Override
    public int insertCommentAttachment(CommentAttachment commentAttachment)
    {
        return commentAttachmentMapper.insertCommentAttachment(commentAttachment);
    }

    /**
     * 修改评论附件
     * 
     * @param commentAttachment 评论附件
     * @return 结果
     */
    @Override
    public int updateCommentAttachment(CommentAttachment commentAttachment)
    {
        return commentAttachmentMapper.updateCommentAttachment(commentAttachment);
    }

    /**
     * 批量删除评论附件
     * 
     * @param ids 需要删除的评论附件主键
     * @return 结果
     */
    @Override
    public int deleteCommentAttachmentByIds(String ids)
    {
        return commentAttachmentMapper.deleteCommentAttachmentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除评论附件信息
     * 
     * @param id 评论附件主键
     * @return 结果
     */
    @Override
    public int deleteCommentAttachmentById(Long id)
    {
        return commentAttachmentMapper.deleteCommentAttachmentById(id);
    }
}
